Skip to content

fix: respect env vars in XKS config.sh - #13

Open
p0wline wants to merge 3 commits into
developfrom
fix/xks-config-env-override
Open

fix: respect env vars in XKS config.sh#13
p0wline wants to merge 3 commits into
developfrom
fix/xks-config-env-override

Conversation

@p0wline

@p0wline p0wline commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Problem

Each individual XKS test script sources utils/config.sh, which used unconditional export VAR="hardcoded-value" assignments. This silently overwrote any variable already set in the environment — making it impossible to inject credentials from outside (CI secrets, shell exports).

Concretely: the CI workflow in Cosmian/kms sets SIGV4_ACCESS_KEY_ID, SIGV4_SECRET_ACCESS_KEY, XKS_PROXY_HOST, etc. before calling test_all, but config.sh was resetting them to the example values, causing all SigV4 authentication to fail.

Fix

Switch all five assignments in utils/config.sh to the ${VAR:-default} pattern:

# before
export SIGV4_ACCESS_KEY_ID="AKIAIOSFODNN7EXAMPLE"

# after
export SIGV4_ACCESS_KEY_ID="${SIGV4_ACCESS_KEY_ID:-AKIAIOSFODNN7EXAMPLE}"

Variables set by the caller are now preserved; the defaults only apply when nothing is exported.

p0wline added a commit to Cosmian/kms that referenced this pull request Aug 11, 2026
test_data now points to fix/xks-config-env-override (d02f52e) which
uses ${VAR:-default} in config.sh — no runtime patching needed.
After Cosmian/test_data#13 is merged, update submodule to develop HEAD.
@p0wline
p0wline force-pushed the fix/xks-config-env-override branch from e32df04 to b342e0a Compare August 14, 2026 09:37
p0wline added a commit to Cosmian/kms that referenced this pull request Aug 14, 2026
test_data now points to fix/xks-config-env-override (d02f52e) which
uses ${VAR:-default} in config.sh — no runtime patching needed.
After Cosmian/test_data#13 is merged, update submodule to develop HEAD.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant